# $Id: PKGBUILD 174813 2013-01-07 18:36:25Z ronald $
# Maintainer: Ronald van Haren <ronald@archlinux.org>
# Contributor: Gustavo Sverzut Barbieri <barbieri@gmail.com>

pkgname=edje
pkgver=1.7.5
pkgrel=1
pkgdesc="A graphical design and layout library based on Evas"
arch=('i686' 'x86_64')
url="http://www.enlightenment.org"
license=('BSD')
depends=('eina' 'ecore' 'evas' 'eio' 'lua' 'shared-mime-info' 'embryo')
optdepends=('python2: inkscape2edc')
install=edje.install
options=('!libtool' '!emptydirs')
source=(http://download.enlightenment.org/releases/$pkgname-$pkgver.tar.gz)
sha1sums=('0bedff456495e30baddd26b908cd0d03285c18a9')

build() {
  cd $srcdir/$pkgname-$pkgver

  export CFLAGS="-fvisibility=hidden -ffunction-sections -fdata-sections ${CFLAGS}"
  export CXXFLAGS="-fvisibility=hidden -ffunction-sections -fdata-sections ${CXXFLAGS}"
  export LDFLAGS="-fvisibility=hidden -ffunction-sections -fdata-sections -Wl,--gc-sections -Wl,--as-needed  ${LDFLAGS}"

  # python2 fix
  sed -i 's_#!/usr/bin/env python_#!/usr/bin/env python2_' utils/inkscape2edc

  ./configure \
    --prefix=/usr \
    --disable-static \
    --disable-sndfile \
    --disable-remix \
    --disable-vorbisenc \
    --disable-alsa \
    --disable-flac \
    --disable-tests \
    --disable-coverage \
    --enable-amalgamation \
    --disable-doc
  make
}

package(){
  cd $srcdir/$pkgname-$pkgver

  make DESTDIR=$pkgdir install

  # install license files
  install -Dm644 $srcdir/$pkgname-$pkgver/COPYING \
        $pkgdir/usr/share/licenses/$pkgname/COPYING
}
